package com.igeek.compus.backend.web.service.impl;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject;
import com.igeek.compus.backend.seller.dao.SellerDao;
import com.igeek.compus.backend.seller.entity.Seller;
import com.igeek.compus.backend.user.dao.UserDao;
import com.igeek.compus.backend.user.entity.User;
import com.igeek.compus.backend.web.service.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class WebServiceImpl implements WebService {

    @Autowired
    private UserDao userDao;

    @Autowired
    private SellerDao sellerDao;

    @Transactional
    @Override
    public void registerSeller(Seller seller) {
        sellerDao.addSeller(seller);
        userDao.updateToSeller(seller.getUserId());
    }

}
